#pragma once

namespace EUniform
{
	enum Type
	{
		PtnSampler,
		PtnFloat1,
		PtnFloat2,
		PtnFloat3,
		PtnFloat4,
		PtnInt1,
		PtnInt2,
		PtnInt3,
		PtnInt4,
		PtnFloat4x4,
		Sampler,
		Float1,
		Float2,
		Float3,
		Float4,
		Int1,
		Int2,
		Int3,
		Int4,
	};
}

struct Uniform
{
	EUniform::Type	m_type;
	unsigned char	m_data[16];
	unsigned int	m_location;

	Uniform() :
		m_location(UINT_MAX)
	{}
};

class Material
{
public:
	Material(const std::string& name);
	~Material();
	
	void			Bind();

	void			SetUniform(EUniform::Type type, const std::string& name, void* value);

	GLenum			m_frontPolygonMode;
	GLenum			m_backPolygonMode;
	
	GLenum			m_depthTestEnabled;
	GLenum			m_depthFunc;

	GLenum			m_blendEnabled;
	GLenum			m_blendSrc;
	GLenum			m_blendDst;
	GLenum			m_blendEquation;

	GLenum			m_cullFace;

private:
	GLSLProgram*	m_shader;

	std::map<const std::string, Uniform>	m_uniform;
};

